package leetcode.code293.FlipGame;

import java.util.ArrayList;
import java.util.List;

public class Solution29301 extends FlipGame {

	@Override
	public List<String> generatePossibleNextMoves(String currentState) {
		List<String> result = new ArrayList<>();
		if (currentState == null || currentState.length() < 2) {
			return result;
		}
		char[] chars = currentState.toCharArray();
		for (int i = 0; i < chars.length - 1; i++) {
			if (chars[i] == '+' && chars[i] == chars[i + 1]) {
				chars[i] = '-';
				chars[i + 1] = '-';
				String str = new String(chars);
				result.add(str);
				chars[i] = '+';
				chars[i + 1] = '+';
			}
		}
		return result;
	}

	public static void main(String[] args) {
		Solution29301 so = new Solution29301();
		so.debug1();
	}

}
